<?php
$id = $_GET['id'];
$shopcode = 'shop' . $id;
if (isset(Yii::app()->request->cookies[$shopcode]->value)) {
    $shoparry = Yii::app()->request->cookies[$shopcode]->value;
    $savedCardArray = json_decode($shoparry, true);
}
?>
<div class="bgtopic">
    <div class="topic_title"> Quảng cáo</div>
</div>
<div class="quangcao a img">
    <?php
    $panel = ShopPanel::model()->findAll(
            array(
                'condition' => ' `flag`=1 and `type`=1 and `shopid`=' . $savedCardArray[0],
                'order' => ' vitri ASC',
                'limit' => 10,
            )
    );
    if (!empty($panel)) {
        foreach ($panel as $p) {
            ?>
    <a href="<?php echo $p->url;?>" target="_blank">
                <img src="<?php echo Yii::app()->request->baseUrl . '/uploadshop/quangcao/' . $p->photo; ?>" width="176">
            </a>
            <?php
        }
    }
    ?>
</div>
